package org.redmagic.agent.location.file;

import java.net.URI;
import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.redmagic.utils.Properties2;

public class CacheLocation extends FileLocation {

    private static final Log LOG = LogFactory.getLog(CacheLocation.class);

    public CacheLocation(String uri) {
        super(uri);
    }

    public CacheLocation(URI uri) {
        super(uri);
    }

    @Override
    public void postProcess(Properties properties) {
        LOG.info("Attempting to cache properties at: " + getURI());
        super.postProcess(properties);
        Properties2.storeProperties(properties, getURI());
        LOG.info("Finished caching properties.");
    }
}